<!DOCTYPE html>
<html lang="en">
<head>
    <title>WSD Admin</title>
    <meta charset="UTF-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
    <link rel="stylesheet" href="__STATICURL__/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="__STATICURL__/css/bootstrap-responsive.min.css"/>
    <link rel="stylesheet" href="__STATICURL__/css/uniform.css"/>
    <link rel="stylesheet" href="__STATICURL__/css/select2.css"/>
    <link rel="stylesheet" href="__STATICURL__/css/matrix-style.css"/>
    <link rel="stylesheet" href="__STATICURL__/css/matrix-media.css"/>
    <link rel="stylesheet" href="__STATICURL__/css/bootstrap-wysihtml5.css"/>
    <link href="__STATICURL__/font-awesome/css/font-awesome.css" rel="stylesheet"/>
    <link rel="stylesheet" href="__STATICURL__/js/datetimepicker/jquery.datetimepicker.css">
</head>
<body>
<include file="Common:header"/>
<div id="content">
    <!--breadcrumbs-->
    <div id="content-header">
        <div id="breadcrumb"><a href="__ROOT__/clover"><i class="icon-home"></i> 主页</a><a href="#"
                                                                                          class="current">推广链接</a></div>
    </div>
    <!--End-breadcrumbs-->
    <div class="container-fluid">

        <div class="row-fluid">
            <div class="span12">
                <div>
                    <!--<li class="field-name">选择开课日期</li>-->
                <span class="field-start">
                  <input id="starttime" placeholder="起始时间" value="<?=$start_time;?>" class="ipt" type="text">
                    <i class="calendar icon" data-for="js_start"></i>
                 </span>
                <span class="field-diff">至</li>
                <span class="field-end">
                  <input class="ipt" type="text" id="endtime" placeholder="截止时间" value="<?=$end_time?>">
                    <i class="calendar icon" data-for=""></i>
                </span>
                </div>
                <div class="widget-box" style="margin-top:0px;">

                    <div class="widget-title"><span class="icon"><i class="icon-th"></i></span>
                        <h5>统计链接平台</h5>
                    </div>

                    <div class="widget-content nopadding">

                        <table class="table table-bordered data-table">
                            <thead>
                            <tr>
                                <th>序号</th>
                                <th>链接</th>
                                <th>来源</th>
                                <th>IP</th>
                                <th>访问时间</th>
                                <th>时间</th>
                            </tr>
                            </thead>
                            <tbody>
                            <foreach name="{promotion_list}" item="vo" key="k">
                                <tr class="gradeX">
                                    <td>{$k+1}</td>
                                    <td>{$vo.promotionurl}</td>
                                    <td>{$vo.fromurl}</td>
                                    <td>{$vo.ip}</td>
                                    <td class="center">{$vo.dt}</td>
                                    <td class="center">{$vo.fulltime|date="Y-m-d",###}</td>
                                </tr>
                            </foreach>

                            </tbody>
                        </table>
                    </div>
                </div>

            </div>
        </div>
    </div>
</div>
<!--Footer-part-->
<include file="Common:footer"/>
<!--end-Footer-part-->
<script src="__STATICURL__/js/jquery.min.js"></script>
<script src="__STATICURL__/js/jquery.ui.custom.js"></script>
<script src="__STATICURL__/js/bootstrap.min.js"></script>
<script src="__STATICURL__/js/jquery.uniform.js"></script>
<script src="__STATICURL__/js/select2.min.js"></script>
<script src="__STATICURL__/js/jquery.dataTables.min.js"></script>
<script src="__STATICURL__/js/matrix.js"></script>
<script src="__STATICURL__/js/matrix.tables.js"></script>
</body>
</html>
<script src="__STATICURL__/js/datetimepicker/jquery.datetimepicker.js"></script>
<script type="text/javascript">
    $('#starttime').datetimepicker({
        timepicker: false,
        lang: "ch",
        format: 'Y-m-d',
        formatDate: 'Y-m-d',
        validateOnBlur: false,
        onShow: function (ct) {
            this.setOptions({
                maxDate: jQuery('#endtime').val() ? jQuery('#endtime').val() : false
            })
        }

    });
    $('#endtime').datetimepicker({
        timepicker: false,
        lang: "ch",
        format: 'Y-m-d',
        formatDate: 'Y-m-d',
        validateOnBlur: false,
        onShow: function (ct) {
            this.setOptions({
                minDate: jQuery('#starttime').val() ? jQuery('#starttime').val() : false
            })
        }
    });
    jQuery('#starttime').datetimepicker({
        timepicker: false,
        scrollInput: false,
        onSelectDate: function (dp, $input) {
            window.location.href = "__URL__/?start_time=" + $input.val() + "&end_time=<?=$end_time?>";
        }
    });
    jQuery('#endtime').datetimepicker({
        timepicker: false,
        scrollInput: false,
        onSelectDate: function (dp, $input) {
            window.location.href = "__URL__/?end_time=" + $input.val() + "&start_time=<?=$start_time?>";
        }
    });

    $(".clear-btn").click(function () {
        if ($(this).parent().hasClass("field-start")) {
            window.location.href = "__URL__/";
        }
        if ($(this).parent().hasClass("field-end")) {
            window.location.href = "__URL__/";
        }
    });
</script>
